Fix: Allow --version option with workload restore#52048
Merged
marcpopMSFT merged 2 commits intorelease/10.0.3xxfrom Jan 24, 2026
Merged
Fix: Allow --version option with workload restore#52048marcpopMSFT merged 2 commits intorelease/10.0.3xxfrom
marcpopMSFT merged 2 commits intorelease/10.0.3xxfrom
Conversation
Copilot
AI
changed the title
[WIP] Fix workload restore failure with specific version input
Fix: Allow --version option with workload restore
Dec 6, 2025
This was referenced Dec 6, 2025
Member
|
Tested in codespaces. Was able to specify different versions when running restore and confirmed it restored the right versions. |
marcpopMSFT
approved these changes
Dec 10, 2025
7c66320 to
a4cb144
Compare
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
a4cb144 to
eaf204d
Compare
nagilson
approved these changes
Jan 22, 2026
Member
nagilson
left a comment
There was a problem hiding this comment.
LGTM, under the assumption IsRunningRestore is correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dotnet workload restore --version <version>fails with error "Cannot use the --skip-manifest-update and --sdk-version options together" even though these options should be compatible for restore operations.Root Cause
workload restoreinternally callsWorkloadInstallCommandwithskipManifestUpdate: trueto avoid duplicate manifest updates. The validation logic rejected this combination without accounting for the restore context where users legitimately specify--versionwhile the implementation usesskipManifestUpdate.Changes
!IsRunningRestoreguard to version/skip-manifest validation (line 158), matching the existing pattern for global.json validation (line 165)--versionno longer triggers the conflict errorExample
Original prompt
This section details on the original issue you should resolve
<issue_title>Can't Restore Workloads with Version</issue_title>
<issue_description>### Describe the bug
dotnet workload restore --versionbreaks if you give it a version (e.g. 9.0.305) or as the --help text suggests, a workload and a version (e.g. ios@9.0.305).To Reproduce
mkdir testcd testdotnet new consoledotnet workload restore --version 9.0.305Exceptions (if any)
dotnet exits with code 1 and this message:
Further technical details
details of dotnet --info
.NET SDK: Version: 9.0.305 Commit: 3fc74f3 Workload version: 9.0.305 MSBuild version: 17.14.21+8929ca9e3
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.305\
.NET workloads installed:
[android]
Installation Source: SDK 9.0.300, VS 17.14.36310.24
Manifest Version: 35.0.101/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.101\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: SDK 9.0.300, VS 17.14.36310.24
Manifest Version: 18.5.9219/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.5.9219\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: SDK 9.0.300, VS 17.14.36310.24
Manifest Version: 18.5.9219/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.5.9219\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: SDK 9.0.300, VS 17.14.36310.24
Manifest Version: 9.0.82/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.82\WorkloadManifest.json
Install Type: Msi
Configured to use workload sets when installing new manifests.
Host:
Version: 9.0.9
Architecture: x64
Commit: 893c2ebbd4
.NET SDKs installed:
2.1.526 [C:\Program Files\dotnet\sdk]
5.0.300 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
6.0.201 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.413 [C:\Program Files\dotnet\sdk]
9.0.302 [C:\Program Files\dotnet\sdk]
9.0.305 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETC...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.